package com.example.tests;

import com.example.fw.ApplicationManager;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import java.io.File;
import java.io.FileReader;
import java.util.Properties;

public class TestBase {


    protected static ApplicationManager appManager;

    @BeforeTest
    public void setUp() throws Exception {
        String configFileName = System.getProperty("configFile", "application.properties");
        Properties properties = new Properties();
        properties.load(new FileReader(new File(configFileName)));
        appManager = new ApplicationManager(properties);
        appManager.init();
        /*appManager.navigateTo()
                .mainPage();*/
    }

    @AfterTest
    public void tearDown() throws Exception {
        appManager.decompose();
    }
}
